﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Tapt.Web.admin
{
    public partial class Admin : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies[ConfigurationManager.AppSettings["AuthCookie"]] == null)
            {
                Response.Redirect("~/admin/Login.aspx");
            }
        }

        protected void Logout(object sender, EventArgs e)
        {
            HttpCookie myCookie = new HttpCookie(ConfigurationManager.AppSettings["AuthCookie"]);
            myCookie.Expires = DateTime.Now.AddDays(-1d);
            Response.Cookies.Add(myCookie);

            Response.Redirect("~/admin/");
        }
    }
}